package com.telit.dispose.service.resourceManagement.impl;

import com.telit.dispose.dao.resourceManagement.FireConfigImgDao;
import com.telit.dispose.dto.ResourceConfigImgDTO;
import com.telit.dispose.entity.resourceManagement.FireConfigImg;
import com.telit.dispose.service.resourceManagement.FireImgService;
import com.telit.dispose.vo.resourceManagement.FireConfigImgVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * Create by Chencf 2022/10/15
 */
@Service
public class FireImgServiceImpl implements FireImgService {

    @Autowired
    private FireConfigImgDao fireConfigImgDao;

    @Override
    public List<FireConfigImgVO> findImgByImgType(Integer imgType) {
        List<FireConfigImgVO> imgByImgType = fireConfigImgDao.findImgByImgType(imgType);
        return imgByImgType;
    }

    @Override
    public void uploadImg(ResourceConfigImgDTO resourceConfigImgDTO) {
        FireConfigImg fireConfigImg = new FireConfigImg();
        fireConfigImg.setImgUrl(resourceConfigImgDTO.getImgUrl());
        fireConfigImg.setImgType(resourceConfigImgDTO.getImgType());
        fireConfigImgDao.insert(fireConfigImg);
    }

}
